﻿namespace XBMCRemote.DataModel.Xbmc
{
    public class JsonRpc
    {
        private JsonRpcClient _client;
        public JsonRpc(JsonRpcClient client)
        {
            _client = client;
        }

        /// <summary>
        /// Ping responder.
        /// Returns an <c>string</c>. "pong" if ping successfull.
        /// </summary>
        public void Ping()
        {
            _client.Invoke("JSONRPC.Ping");
        }

        /// <summary>
        /// Get notification flags.
        /// Returns an <c>object</c>.
        /// </summary>
        public void GetNotificationFlags()
        {
            _client.Invoke("JSONRPC.GetNotificationFlags");
        }

        /// <summary>
        /// Enumerates all actions and descriptions. 
        /// Returns an <c>object</c>.
        /// </summary>
        /// <param name="args">
        /// [ boolean getdescriptions = True ]
        /// [ boolean getmetadata = False ]
        /// [ boolean filterbytransport = True ]
        /// </param>
        public void Introspect(object[] args)
        {
            _client.Invoke("JSONRPC.Introspect", args);
        }
    }
}
